package com.whp02.annotation.bean;

import com.whp02.annotation.configurationclasspostprocessor.ex02config.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wanghp
 * @version 1.0
 * @description: TODO
 * @date 2020/12/24 15:42
 */
@Configuration
public class ConfigBean {

	//bean名称为方法默认值：user1
	@Bean
	public User user1() {
		return new User();
	}

	//bean名称通过value指定了：user2Bean
	@Bean("user2Bean")
	public User user2() {
		return new User();
	}

	//bean名称为：user3Bean，2个别名：[user3BeanAlias1,user3BeanAlias2]
	@Bean({"user3Bean", "user3BeanAlias1", "user3BeanAlias2"})
	public User user3() {
		return new User();
	}
}
